package com.tmanager.web.listeners;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.servlet.GuiceServletContextListener;
import com.tmanager.persistence.tx.TxModule;

public class StartupGuiceListener extends GuiceServletContextListener{
	private static final Logger log = LoggerFactory.getLogger(StartupGuiceListener.class);

	@Override
	public void contextInitialized(ServletContextEvent servletContextEvent) {
		super.contextInitialized(servletContextEvent);
		log.debug("Guice Initialized");
	}
	
	@Override
	protected Injector getInjector() {
		return Guice.createInjector(new TxModule());
	}

}
